/* eslint-disable no-unused-expressions */
/* 解决跨域问题 */
const proxyObj = {}
proxyObj['/'] = {
  // websocket
  ws: false,
  // 目标地址
  // 何文林
  // target: 'http://123.60.224.189:9888/clouddocument',
  target: 'http://121.36.218.32:9887/clouddocument', // 发送请求头host会被设置target
  // target: 'http://192.168.43.26:9888/clouddocument',
  // 是否跨域
  changeOrigin: true,
  // 不重写请求地址
  pathReWrite: {
    '^/': '/'
  }
}

module.exports = {
  // configureWebpack: config => {
  //   config.entry.app = ['babel-polyfill', './src/main.js']
  // },
  // configureWebpack: {
  //   resolve: {
  //     alias: {
  //       querystring: 'querystring-browser'
  //     }
  //   }
  // },
  // entry: {

  //   app: ['babel-polyfill', './src/main.js']

  // },
  devServer: {
    // before: require('./src/mock/index'),
    host: 'localhost',
    port: 8080,
    proxy: proxyObj
  },
  // 添加兼容
  chainWebpack: config => {
    config.entry.app = ['classlist-polyfill', 'babel-polyfill', './src/main.js']
  }
}
